/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package ru.staf.NetworkReportGenerator;

import java.io.IOException;
import java.net.InetAddress;
import java.net.Inet4Address;
import java.net.UnknownHostException;

import java.util.TreeSet;
import java.util.Iterator;

/**
 *
 * @author aezhov
 */
public class NetworkBuzzer {
    public static void shakeTheNet(TreeSet<String> ipSet)
        throws java.net.UnknownHostException, java.io.IOException
    {
        Iterator<String> it = ipSet.iterator();
        while (it.hasNext()) {
            String address = it.next();
            System.out.println("Pinging " + address);
            InetAddress addr = InetAddress.getByName(address);
            addr.isReachable(1);
        }
    }
}
